package com.wq.controller;

import com.wq.common.Result;
import com.wq.service.FileService;
import com.wq.vo.FileUploadVO;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/admin/file")
@Slf4j
public class FileController {
    @Resource
    private FileService fileService;
    @PostMapping("upload")
    private Result<FileUploadVO> upload(MultipartFile file){
        FileUploadVO fileUploadVO=fileService.upload(file);

        return Result.success(fileUploadVO);

    }
}
